package com.yugao.fintech.antelope.shop.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yugao.fintech.antelope.base.model.BasePO;
import com.yugao.fintech.antelope.base.tenant.core.DataIsolation;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 出入库存明细
 *
 
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("shop_sku_stock_in_out_detail")
@DataIsolation(filterMainTenant = true, filterTenant = true, tableName = "shop_sku_stock_in_out_detail")
public class SkuStockInOutDetail extends BasePO {
    @TableId
	private Long id;
	
	/**
	 * 出入库记录id
	 */
	private Long stockRecordId;
	
	/**
	 * sku id
	 */
	private Long skuId;
	
	/**
	 * 改变数量, 负数表示出库
	 */
	private Integer changeCount;
	
	/**
	 * 操作人id
	 */
	private Long operaterId;
	
	/**
	 * 操作人姓名
	 */
	private String operaterName;
	
	/**
	 * 操作时间
	 */
	private Date operaterTime;
	
	/**
	 * 商品id
	 */
	private Long goodsId;
	
	/**
	 * 成本单价
	 */
	private BigDecimal costPrice;
	
	/**
	 * 总成本价
	 */
	private BigDecimal totalCostPrice;
	
	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date createdAt;
	
	/**
	 * 备注
	 */
	private String remark;

    public static LambdaQueryWrapper<SkuStockInOutDetail> lqw() {
		return Wrappers.lambdaQuery();
	}
}
